Skip to content

tests: cover native module pk3 loading guards#263

Draft
cursor[bot] wants to merge 2 commits into
next-gen-5from
cursor/missing-test-coverage-aa53
Draft

tests: cover native module pk3 loading guards#263
cursor[bot] wants to merge 2 commits into
next-gen-5from
cursor/missing-test-coverage-aa53

Conversation

@cursor

@cursor cursor Bot commented Jun 15, 2026

Copy link
Copy Markdown

Risky behavior now covered

  • pk3-backed native module extraction/cache path controlled by com_nativeLibraryExtractPk3.
  • Basename-only native cache placement under vm/native_cache/, direct/vm/modules fallback order, explicit-path no-fallback behavior, disk length+CRC cache reuse, direct cache writes, diagnostics, and FS_LoadLibrary probing pk3 cache before loose files.
  • Lua debug script loading fallback from luaL_loadfile to FS_ReadFile + luaL_loadbuffer for scripts stored in pk3s.

Test files added/updated

  • Added tests/scripts/test_native_module_regressions.sh.
  • Registered test_native_module_regressions in CMakeLists.txt.
  • Updated tests/README.md validation list.

Why this reduces regression risk

Native module loading is a core mod/full-conversion path, and failures can silently break pk3-only native UI/game modules. These deterministic guards protect the intended extraction/cache invariants without requiring real game data, native libraries, or dlopen-capable fixtures.

Validation

  • tests/scripts/test_native_module_regressions.sh
  • cmake -S . -B build-coverage-tests -DBUILD_TESTING=ON -DBUILD_UNIT_TESTS=OFF && ctest --test-dir build-coverage-tests -R test_native_module_regressions --output-on-failure
Open in Web View Automation 

cursoragent and others added 2 commits June 15, 2026 10:06
Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant